<?php

/**
 * Template adapter / helper
 *
 * dont want to call to much pq syntax in the fw.
 */

class FWtemplate extends FWobject
{
    
    function init() {}

    /**
     * adapter to create the document file in $r->t
     * @todo shold be used?!
     */
    function create( $type = "html4" )
    {
        /**
         * include basic type
         */
         
        $path = __FwP.'/blueprint/basic/' . strtolower( $type ) . '.html';

        if(file_exists( $path ))
        {
            $this->r->t = phpQuery::newDocumentFile( $path );
            return TRUE;
        }

        /*
         * Handle some basic template stuff
         */
        $this->r->t["body"]->append('<ul></ul>');
        $this->r->t["ul"] = "<li>1</li><li>2</li>";
    }

    /**
     *
     * phpQuery Adapter to display Template
     */
    public function beamToReality()
    {

        return $this->r->t;

    }
    /*
    public function __toString() {

        return (string)$this->beamToReality();

    }
     * 
     */
    
}

?>
